//
//  UserDetailViewController.m
//  ROSE
//
//  Created by 艾阳 on 2018/5/31.
//  Copyright © 2018年 HeNanZhongDunYunAn. All rights reserved.
//

#import "UserDetailViewController.h"
#import "ChangePSDViewController.h"

@interface UserDetailViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong) UITableView *tableView;
@property (nonatomic,strong) NSArray *titleArray;
@end

@implementation UserDetailViewController

- (NSArray *)titleArray{
    if (!_titleArray) {
        _titleArray = @[@"登录密码"];
    }
    return _titleArray;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor =[UIColor whiteColor];
    self.title = @"账户";
    self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, size_width, size_height)];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.tableFooterView = [[UIView alloc] init];
    self.tableView.scrollEnabled = NO;

    [self.view addSubview:self.tableView];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 90;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle: UITableViewCellStyleSubtitle
                                      reuseIdentifier: NSStringFromClass([UITableViewCell class])];
    }
    cell.textLabel.text = self.titleArray[indexPath.row];
    cell.detailTextLabel.text=@"******已设置";
    cell.detailTextLabel.textColor = [UIColor lightGrayColor];
    //去修改
    UILabel * goToEdit = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 20)];
    goToEdit.text = @"去修改";
    goToEdit.font = [UIFont systemFontOfSize:13];
    goToEdit.textAlignment = NSTextAlignmentRight;
    goToEdit.textColor = [UIColor redColor];
    cell.accessoryView  = goToEdit;
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}




- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    ChangePSDViewController * changePSDVc = [[ChangePSDViewController alloc]init];
    [self.navigationController pushViewController:changePSDVc animated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
